<?php


namespace app\api\validate;


use think\Validate;

class GoodsValidate extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'cate_id' => ['require', 'egt:0'],
        'is_index' => ['require', 'in:0,1'],
        'sort_field' => ['require', "in:none,all,hot,price"],
        'sort' => ['require', "in:asc,desc"],
        'search' => ['require'],
        'goods_id' => ['require', 'gt:0'],
    ];

    /**
     * 提示消息
     */
    protected $message = [];

    /**
     * 验证场景
     */
    protected $scene = [
        'getPageList' => [
            'cate_id','is_index','sort_field','sort'
        ],
        'getDetail' => [
            'goods_id'
        ],
    ];
}